package sheshen.come.cn.sheshen.inner;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import sheshen.come.cn.sheshen.utils.NetUtils;

/**
 * Created by MyPC on 2017/2/17.
 */

public class NetChangeReceiver extends BroadcastReceiver{
    private OnNetChangeListener onNetChangeListener;

    public void setOnNetChangeListener(OnNetChangeListener onNetChangeListener) {
        this.onNetChangeListener = onNetChangeListener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {

        if (NetUtils.getNetworkType(context) == 3) {// 网络是WIFI

        } else if (NetUtils.getNetworkType(context) == 2
                || NetUtils.getNetworkType(context) == 4) {// 网络不是手机网络或者是以太网
            // TODO 更新状态是暂停状态


        } else if (NetUtils.getNetworkType(context) == 1) {// 网络链接断开

        } else {//不可用

        }
    }
}
